package com.xy.creature;

import java.util.ArrayList;
/**
 * @description:妖怪集合
 * @author: Xiang Yao
 * @date: Created in 2020/6/7
 */
public class MonsterSet {
    private ArrayList<Monster> monsters=new ArrayList<Monster>();


    //增删改查
    public Monster get(String id){
        Monster monster = null;
        for (Monster item:monsters){
            if(true == id.equals(item.getId())){
                monster = item;
                break;
            }
        }
        return monster;
    }


    public MonsterSet() {
    }

    public MonsterSet(ArrayList<Monster> monsters) {
        this.monsters = monsters;
    }

    public ArrayList<Monster> getMonsters() {
        return monsters;
    }

    public void setMonsters(ArrayList<Monster> monsters) {
        this.monsters = monsters;
    }



//    public void get(String cmdLineItem) {
//    }
}
